package generic;

import java.util.ArrayList;
import java.util.List;


class A{}

class B extends A{}

class C extends A{}

public class GenericTest {
	
	
	public static void genericEFunction(List<? extends A> extList){
		for(Object obj : extList){
			System.out.println(obj);
		}
	}
	
	public static void genericSFunction(List<? super C> supList){
		for(Object obj : supList){
			System.out.println(obj);
		}
	}
	
	public static void main(String[] args) {
		/*List<C> listC = new ArrayList<C>(2);
		listC.add(new C());
		genericEFunction(listC);*/
		
		List<A> listA = new ArrayList<A>(2);
		listA.add(new A());
		genericSFunction(listA);
		
	}
}
